<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        html,
        body {
            height: 100%;
            position: relative;
            overflow: hidden;
            margin: 0;
            padding: 0;
        }

        .background-image {
            width: 110%;
            height: 110%;
            position: absolute;
            left: 0;
            top: 0;
            background:
                url('https://cn.bing.com/th?id=OHR.MauricieAutumn_ZH-CN3300167870_768x1366.jpg&rf=LaDigue_1920x1080.jpg') no-repeat center center / cover;
        }
    </style>
</head>

<body>
    <div class="background-image"></div>
</body>
<script>
    const bg = document.querySelector('.background-image')
    const windowWidth = window.innerWidth / 5
    const windowHeight = window.innerHeight / 5
    bg.onmousemove = (e) => {
        const mouseX = e.clientX / windowWidth
        const mouseY = e.clientY / windowHeight
        bg.style.transform = 'translate3d(-' + mouseX + '%, -' + mouseY + '%, 0)'
    }
</script>

</html>